import { createStore } from 'vuex'
import getters from './getters'
import category from './modules/category.js'
import theme from './modules/theme.js'
import app from './modules/app.js'
import search from './modules/search.js'
import user from './modules/user.js'
// 引入persistedstate插件
import createPersistedState from 'vuex-persistedstate'
const store = createStore({
  getters,
  modules: { category, theme, app, search, user },
  plugins: [
    createPersistedState({
      key: 'category-data',
      paths: ['category', 'theme', 'search']
    })
  ]
})
export default store
